home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 85 / CDMM85_1.ISO / Monopoly Tycoon / MTycoonDemo.exe / data1.cab / scripts / TUTORIAL9 / hub.lua < prev    next >
Encoding:
Text File  |  2001-10-24  |  10.1 KB  |  239 lines

  1. PromptHeading = ID_TUTORIAL_9_OFFSET + 1
  2. g_currentprompt = 0;
  3. g_counter = 0;
  4. Tweaks.numyearsin24hours = 0;
  5.  
  6. -------------------------------------------------------------------------------------------------
  7. -- INITIALISE_Level. Standard level event
  8. -------------------------------------------------------------------------------------------------
  9. function EVENTINITIALISE_Level()
  10.     --Game.Pause();
  11.     -- load the building and business file
  12.     C_RunScript("scripts\\maps\\tempmap.lua");
  13.     C_RunScript("scripts\\tutorial9\\initialpref.lua");
  14.  
  15. end;
  16.  
  17. -------------------------------------------------------------------------------------------------
  18. -- Level. Standard level event.
  19. -------------------------------------------------------------------------------------------------
  20. function EVENT_Level()
  21.     -- create an initial prompt
  22.     C_TriggerEvent("BlockCam", 1, PACIFIC_AVENUE);
  23.     -- Game.Unpause();
  24.     Interface.DisableAllControls();
  25.     Interface.DisableAll3DPicking();
  26.     Interface.DisableCameraControl();
  27.     C_TriggerEvent("SetPlanView", 1);
  28.     -- create the initial prompt
  29.     CreatePrompt(1);
  30. end;
  31.  
  32. function EVENT_AIBid(a)
  33.         Interface.ForcePlayerToBid(a, 50*a);     
  34. end;
  35.  
  36. function EVENT_AIPass(a)
  37.         Interface.ForcePlayerToPass(a);      
  38. end;
  39.  
  40. function EVENT_AIPullout(a)
  41.         Interface.ForcePlayerToPullOut(a);      
  42. end;
  43.  
  44. function CATCHEVENT_InterfacePromptDismiss(a)
  45.  
  46.     if g_currentprompt == 21 then
  47.         Game.Unpause();
  48.         C_TriggerEvent("AIPullout", 25, 1);
  49.         C_TriggerEvent("AIPullout", 125, 2);
  50.         g_counter = g_counter + 1;
  51.         return 0;
  52.     end;
  53.  
  54.     if g_currentprompt == 18 then
  55.         Game.Unpause();
  56.         C_TriggerEvent("AIBid", 25, 1);
  57.         C_TriggerEvent("AIBid", 125, 2);
  58.         C_TriggerEvent("AIPullout", 225, 3);
  59.         g_counter = g_counter + 1;
  60.         return 0;
  61.     end;
  62.             
  63.     if g_currentprompt == 15 then
  64.         Game.Unpause();
  65.         C_TriggerEvent("AIBid", 25, 1);
  66.         C_TriggerEvent("AIBid", 125, 2);
  67.         C_TriggerEvent("AIPass", 225, 3);
  68.         g_counter = g_counter + 1;
  69.         return 0;
  70.     end;
  71.  
  72.    if g_currentprompt == 6 then
  73.             Game.Unpause();
  74.         else
  75.             CreatePrompt(a);
  76.     end;
  77. end;
  78.  
  79. function CATCHEVENT_TutorialEvent(a)
  80.  
  81.     if a ~= TUT_MYGO and g_currentprompt == 21 then
  82.         Interface.DismissPrompt();
  83.     end;
  84.  
  85.     if a == TUT_MYGO and g_currentprompt == 21 then
  86.         Interface.DisableAllControls();
  87.         CreatePrompt(22);
  88.         Interface.DisableControl(TUT_AUCTION_50);
  89.         Interface.DisableControl(TUT_AUCTION_100);
  90.         Interface.DisableControl(TUT_AUCTION_500);
  91.         Interface.DisableControl(TUT_AUCTION_PASS);
  92.         Interface.DisableControl(TUT_AUCTION_PULLOUT);
  93.     end;
  94.  
  95.     if a ~= TUT_MYGO and g_currentprompt == 18 then
  96.         Interface.DismissPrompt();
  97.     end;
  98.  
  99.     if a == TUT_MYGO and g_currentprompt == 18 then
  100.         Interface.DisableAllControls();
  101.         CreatePrompt(19);
  102.         Interface.DisableControl(TUT_AUCTION_50);
  103.         Interface.DisableControl(TUT_AUCTION_100);
  104.         Interface.DisableControl(TUT_AUCTION_500);
  105.         Interface.DisableControl(TUT_AUCTION_PASS);
  106.         Interface.DisableControl(TUT_AUCTION_PULLOUT);
  107.     end;
  108.  
  109.     if g_currentprompt == 17 then
  110.         Interface.DismissPrompt();
  111.     end;
  112.  
  113.     if a == TUT_MYGO and g_currentprompt == 15 then
  114.         Interface.DisableAllControls();
  115.         CreatePrompt(16);
  116.         Interface.DisableControl(TUT_AUCTION_50);
  117.         Interface.DisableControl(TUT_AUCTION_100);
  118.         Interface.DisableControl(TUT_AUCTION_500);
  119.         Interface.DisableControl(TUT_AUCTION_PASS);
  120.         Interface.DisableControl(TUT_AUCTION_PULLOUT);
  121.     end;
  122.  
  123.     if a == TUT_BEGINAUCTION then
  124. --        Interface.DismissPrompt();
  125.         CreatePrompt(7);
  126.     end;
  127.  
  128.     if g_currentprompt == 4 then
  129.         Interface.DismissPrompt();
  130.         Interface.DisableControl(TUT_MPP_BLOCK_BUYBLOCK);
  131.     end;
  132.  
  133.     if g_currentprompt == 3 then
  134.         Interface.DismissPrompt();
  135.         Interface.DisableControl(TUT_MPP_GREENBUTTON_2);
  136.     end;
  137.  
  138. end;
  139.  
  140.  
  141. function CATCHEVENT_Picked3D(a)
  142.     if a == 1 and g_currentprompt == 2 then
  143.         Interface.DismissPrompt();
  144.         Interface.DisableAll3DPicking();
  145.     end;        
  146. end;
  147.  
  148. -- prompt manager
  149. function CreatePrompt(a)
  150.     g_currentprompt = a;
  151.     body = a+PromptHeading;
  152.     if a == 1 then
  153.         Interface.CreatePrompt(PromptHeading,body, a+1); --"We've already touched on auctions, but now we'll look at one in more detail...",a+1);
  154.     elseif a == 2 then
  155.         Interface.CreateMessage(PromptHeading,body, a+1); --"Our auction will revolve around Pacific Avenue. Double click on it.", a+1);
  156.         Interface.EnableBlockPicking(PACIFIC_AVENUE);
  157.         Interface.PositionPrompt(0,100);
  158.         Interface.AddArrow(452,177);
  159.     elseif a == 3 then
  160.         Interface.CreateMessage(PromptHeading,body, a+1); --"Click on the Lease Block button. ", a+1);
  161.         Interface.EnableControl(TUT_MPP_GREENBUTTON_2);
  162.         Interface.AddArrow(29,92);
  163.     elseif a == 4 then
  164.         Interface.CreateMessage(PromptHeading,body, a+1); --"There is a minimum offer price, but if you want you can increase this value. When you click the Lease Block button an auction will be triggered. The offer price that you set will be the opening bid. Click Lease Block now.", a+1);
  165.         Interface.EnableControl(TUT_MPP_BLOCK_BUYBLOCK);
  166.         Interface.PositionPrompt(0,-100);
  167.         Interface.AddArrow(158,128);
  168.     elseif a == 5 then
  169.         Interface.CreatePrompt(PromptHeading,body, a+1); --"The auction has now been registered and will take place when the timer reaches zero. If the auction timer is running no one else is able to put in an offer for a block until after the auction. Also, you cannot build on the block that is going to auction.", a+1);
  170.         Interface.PositionPrompt(0,100);
  171.         Interface.AddArrow(616,114);
  172.         Game.Pause();
  173.     elseif a == 6 then
  174.         Interface.CreatePrompt(PromptHeading,body, a+1); --"You can get more information by clicking here. Click Continue to un-pause the game and go to auction.", a+1);
  175.         Interface.EnableControlAndChildren(TUT_AUCTION_TIMER_PANEL);
  176.         Interface.AddArrow(613,88);
  177.     elseif a == 7 then
  178.         Interface.CreatePrompt(PromptHeading,body, a+1); --"This is the Auction Room. It is here that you will bid for the lease of the City Block. We've frozen time to give you a chance to look around.", a+1);
  179.     elseif a == 8 then
  180.         Interface.CreatePrompt(PromptHeading,body, a+1); --"This panel tells you the Block Lease that you are bidding for, and who holds the current bid.", a+1);
  181.         Interface.AddArrow(321, 32);
  182.     elseif a == 9 then
  183.         Interface.CreatePrompt(PromptHeading,body, a+1); --"This is you. As you put in the initial offer on the block, you hold the current bid. That's why your bid value is drawn so big.", a+1);
  184.         Interface.AddArrow( 180, 160);
  185.     elseif a == 10 then
  186.         Interface.CreatePrompt(PromptHeading,body, a+1); --"You can also see how much cash you are holding.", a+1);
  187.         Interface.PositionPrompt(0,-140);
  188.         Interface.AddArrow( 180, 257);
  189.     elseif a == 11 then
  190.         Interface.CreatePrompt(PromptHeading,body, a+1); --"You can see other players' cash as well. This is useful when trying to decide how far to push the bidding.", a+1);
  191.         Interface.AddArrow( 377, 262);
  192.     elseif a == 12 then
  193.         Interface.CreatePrompt(PromptHeading,body, a+1); --"This player is thinking. When the game is un-paused they will either bid, pass or pull out. We'll cover this in detail a little later. The pulsing spotlight helps you identify the player who's turn it is.", a+1);
  194.         Interface.AddArrow(252, 277);
  195.     elseif a == 13 then
  196.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Here you can see who owns the buildings on this block. If you hover the cursor over one of the buildings the tool-tip will tell you what business is running there.", a+1);
  197.         Interface.AddArrow(118,393);
  198.     elseif a == 14 then
  199.         Interface.CreatePrompt(PromptHeading,body, a+1); --"This panel is very important. It tells you who already owns blocks in the city. Be sure to try to stop anyone else getting a Monopoly - all the blocks in a colour group.", a+1);
  200.         Interface.AddArrow(523, 372);
  201.     elseif a == 15 then
  202.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Okay, let's get on with the auction. When you click continue the game will un-pause and the other players will make their bids.", a+1);
  203.     elseif a == 16 then
  204.         Interface.CreatePrompt(PromptHeading,body, a+1); --"It looks like the other players' have an interest in this block too.", a+1);
  205.     elseif a == 17 then
  206.         Interface.CreatePrompt(PromptHeading,body, a+1); --"You have a limited time to put in your bid. If the timer runs out you will automatically pull out of the auction. For this tutorial, you will remain in the auction when the counter hits 0.", a+1);
  207.         Interface.AddArrow(137, 75);
  208.     elseif a == 18 then
  209.         Interface.CreateMessage(PromptHeading,body, a+1); --"Now it is your turn to bid. All you need to do is select how much you want to raise it. Choose $50, $100 or $500, depending on how rich you feel, and how much you want the block.", a+1);
  210.         Interface.AddArrow(310, 346);
  211.         Interface.EnableControl(TUT_AUCTION_50);
  212.         Interface.EnableControl(TUT_AUCTION_100);
  213.         Interface.EnableControl(TUT_AUCTION_500);
  214.         Interface.DisableControl(TUT_AUCTION_PASS);
  215.         Interface.DisableControl(TUT_AUCTION_PULLOUT);
  216.     elseif a == 19 then
  217.         Interface.CreatePrompt(PromptHeading,body, a+1); --"If you click this button you would withdraw from the auction. The two remaining players would bid until one pulled out. The winner would take the block lease.", a+1);
  218.         Interface.AddArrow( 281, 431);
  219.     elseif a == 20 then
  220.         Interface.CreatePrompt(PromptHeading,body, a+1); --"If you clicked here you would pass. As long as someone else bids you will stay in the auction. If no one else bids, the current bid holder will take the property lease.", a+1);
  221.         Interface.AddArrow( 348, 432);
  222.     elseif a == 21 then
  223.         Interface.CreateMessage(PromptHeading,body, a+1); --"Bid again and try to win the block.", a+1);
  224.         Interface.AddArrow( 326, 393);
  225.         Interface.EnableControl(TUT_AUCTION_50);
  226.         Interface.EnableControl(TUT_AUCTION_100);
  227.         Interface.EnableControl(TUT_AUCTION_500);
  228.         Interface.DisableControl(TUT_AUCTION_PASS);
  229.         Interface.DisableControl(TUT_AUCTION_PULLOUT);
  230.     elseif a == 22 then
  231.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Well done - you've won your first auction. You now have the lease for twenty-five years. Once this time expires the city will reclaim the lease. Make the most of your rent-free time, and if possible, build up and collect the leases for all the properties in this group.", a+1);
  232.         Game.Pause();
  233.     elseif a == 23 then
  234.         Game.End(true);
  235.     end;
  236. end;
  237.  
  238.  
  239.